#-*-coding:utf-8-*-
__author__ = 'toriycn'



import urllib3
http = urllib3.PoolManager()
# r = http.request('GET', 'http://www.baidu.com/')
# r.status
# print(r.data)


# fields = {
#     'foo': 'bar',
#     'fakefile': ('foofile.txt', 'contents of foofile'),
#     'file': ('barfile.tar.gz', open("/Users/toriycn/Downloads/jdk-7u79-linux-x64.tar.gz","rb").read()),
#     'typedfile': ('bazfile.bin', open("/Users/toriycn/Documents/log").read(),
#                   'image/jpeg'),
#     'nonamefile': 'contents of nonamefile field',
# }
# r = http.request_encode_body('POST','127.0.0.1:7259/upload',fields,None,True)
# print(r.status)
#

from struct import *
bts = pack("!I4s",100,"董累".encode("GBK"))
print(bts)
bts1 = pack("6s","董累".encode("GBK"))
print(bts1)

print(bts+bts1)

SOURCE_PATH ="/Users/toriycn/workspace"

import os
if __name__ == '__main__':
   FileList =[]
   for parent,pathfile,filenames in os.walk(SOURCE_PATH):
       if filenames:
           for filename in filenames:
               if filename.endswith("py"):
                 FileList.append(os.path.join(parent,filename))

   print(len(FileList))
   for filename in FileList:
       print(filename)
   aa =1

